﻿@model UploadModel
@{
    Layout = null;
}

<html>
    <head>
        <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="~/Content/bootstrap-fileupload/bootstrap-fileupload.min.css" rel="stylesheet" media="screen">
        <script src="http://code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
        <script src="~/Content/bootstrap/js/bootstrap.min.js"></script>
        <script src="~/Content/bootstrap-fileupload/bootstrap-fileupload.min.js" type="text/javascript"></script>
        <title></title>

<!--[if lt IE 7 ]>
        <style type="text/css">
            input#filedata { width: 350px; }
            div#filepreview { margin: 0 0 10px 0; height: 30px; }
        </style>
<![endif]-->

    </head>
    <body style="height:100px;">
        <form method="post" enctype="multipart/form-data" action="/File/Upload">
            @Html.HiddenFor(m => m.articleId)
            @Html.HiddenFor(m => m.type)
            
            <div class="fileupload fileupload-new" data-provides="fileupload">
                <div class="input-append">
                    <div class="uneditable-input span4" id="filepreview">
                        <i class="icon-file fileupload-exists"></i> 
                        <span class="fileupload-preview" ></span>
                    </div>
                    <span class="btn btn-file">
                        <span class="fileupload-new">파일선택</span>
                        <span class="fileupload-exists">파일변경</span>
                        <input type="file" name="filedata" id="filedata" />
                    </span>
                </div>
            </div>

        </form>

        @if (HttpContext.Current.Request.HttpMethod == "POST") {
            if (Model.작업성공) {
                <script type="text/javascript">
                    parent.파일첨부_성공콜백(@Model.articleId, @Model.type );
                </script>
            } else {
                <script type="text/javascript">
                    parent.파일첨부_실패콜백(@Model.articleId, @Model.type );
                </script>
            }
        }
        @if (Model.에러메시지 != null) {
            <script type="text/javascript">
                 alert('@Model.에러메시지');
            </script>
        }
    </body>

</html>
